////////////////////////////////////////////////////////////////
// filename: input.h
// description: header file for the input class
// autor: Jay Tomten (jaytomten@gmail.com)
// notes:

// namespace
using namespace std;

// defines
#ifndef __INPUT__
#define __INPUT__

#define INPUT_1P       8933
#define INPUT_2P       8934
#define INPUT_CUSTOM   8935

#define ANALOG_THRESHOLD 10000

// includes
#include <SDL/SDL.h>

// globals
struct Key   // specific key data
    {
    int    key;
    bool   active;
    bool   used;
    };

struct KeyInput   // our current key confinguration
    {
    Key up;
    Key down;
    Key left;
    Key right;
    Key select;
    Key cancel;
    Key escape;
    };

struct Button   // specific mouse button data
    {
    bool active;
    bool used;
    };

struct MouseInput   // our mouse position and button config
    {
    int    x;
    int    y;
    Button left;
    Button right;
    Button wheelUp;
    Button wheelDown;
    float  wheelDelta;
    };

class Input
    {

    public:

        KeyInput   keyStatePlayer1; // player 1 key states
        KeyInput   keyStatePlayer2; // player 2 key states
        MouseInput mouseState;      // mouse information
        SDL_Joystick *joy1;
        SDL_Joystick *joy2;

        Input();  // constructor
        ~Input(); // destructor

        void Init(int type);
        bool Update(float d);

    private:

        SDL_Event event;           // the SDL event var

    };

#endif
